package com.huluobo.a2202mvvm_im_douyindemo.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.a2202mvvm_im_douyindemo.R;
import com.huluobo.a2202mvvm_im_douyindemo.bean.ShopBeanResult;
import com.huluobo.a2202mvvm_im_douyindemo.utils.ImageLoader;

import java.util.List;

/**
 * Created by LC on 2024/5/15.
 */
public class GoodsAdapter extends BaseQuickAdapter<ShopBeanResult.ShopBean, BaseViewHolder> {

    public GoodsAdapter(@Nullable List<ShopBeanResult.ShopBean> data) {
        super(R.layout.item_shop_goods, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, ShopBeanResult.ShopBean shopBean) {
        ImageLoader.getInstance().loadImage(getContext(), shopBean.getGoods_default_icon(),
                baseViewHolder.getView(R.id.item_shop_goods_icon));
        baseViewHolder.setText(R.id.item_shop_goods_desc, shopBean.getGoods_desc());
        baseViewHolder.setText(R.id.item_shop_goods_price, shopBean.getGoods_default_price() + "元");
    }
}
